<include file="Public:header" />
<script>
    function sendMsg(){
        var ids=new Array();
        $('.sall').each(function(index, element) {
            if($(this).prop('checked')){
                ids.push($(this).next('input').val());
            }
        });
        if(ids.length>0){
            $.ajax({
                url:'{:U('sendMsg')}',
                data:'msg='+$('#save-source').val()+'&ids='+ids.toString(),
                type:'POST',
                dataType:"json",
                success: function(data){
                    success('成功发送了'+data.info+'条信息！');
                }
            });
        }else{
            error('请选择要发送信息的对象！');
        }
    }
</script>
<div class="container main"> <include file="Public:left" />
    <div class="w790">
        <div class="h">
            <if condition="getAccessMenu($accessList, 'Admin', 'Member_bank', 'bank_add')">
                <a href="{:U('bank_add')}" class="btn btn-info"><i class="glyphicon glyphicon-plus"></i>添加银行卡</a>
            </if>
            <if condition="getAccessMenu($accessList, 'Admin', 'Member_account_log', 'draw_list')">
                <a href="{:U('Member_account_log/draw_list')}" class="btn btn-info"><i class="glyphicon glyphicon-plus"></i>提现记录</a>
            </if>
            <if condition="getAccessMenu($accessList, 'Admin', 'Member_bank', 'detail')">
                <a href="{:U('detail',['site_id'=>143])}" class="btn btn-info"><i class="glyphicon glyphicon-plus"></i>申请提现</a>
            </if>
            <div style="clear:both;"></div>
        </div>
        <div class="table_">
            <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
                <thead>
                <tr>
                    <td align="center">开户银行</td>
                    <td align="center">开户名</td>
                    <td align="center">账号</td>
                    <td align="center">操作</td>
                </tr>
                </thead>
                <?php if(!isset($list)){ echo '<tr><td colspan="4" align="center" >暂无数据</td></tr>';} ?>
                <volist name="list" id="vo">
                    <tr>
                        <td align="center">{$vo.depositbank}</td>
                        <td align="center">{$vo.accountname}</td>
                        <td align="center">{$vo.account}</td>
                        <td align="center"><a  href="{:U('edit',array('id'=>$vo['id']))}">修改</a></td>
                    </tr>
                </volist>
            </table>
            <div class="pages">
                <div class="controlList fl">
                    <if condition="getAccessMenu($accessList, 'Admin', 'Member', 'sendCoupon')">
                        <notempty name="coupons">
                            <a type="button" class="btn btn-sm btn-primary" id="button-download-modal" data-target="#couponModal" role="button" data-toggle="modal"> <i class="glyphicon glyphicon-send"></i> 赠送优惠券 </a>
                        </notempty>
                    </if>
                    <if condition="getAccessMenu($accessList, 'Admin', 'Member', 'sendMsg')">
                        <a type="button" class="btn btn-sm btn-primary" id="button-download-modal" data-target="#downloadModal" role="button" data-toggle="modal"> <i class="glyphicon glyphicon-send"></i> 发送信息 </a>
                    </if>
                    <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="sall();"><i class="glyphicon glyphicon-check"></i> 全选/反选</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="rall();"><i class="glyphicon glyphicon-unchecked"></i> 全不选</a> <a class="btn btn-danger btn-sm" href="javascript:void(0);" onclick="delall();"><i class="glyphicon glyphicon-trash"></i> 删除选中</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="update_sort('id','sort','','{:U('dosort')}');"><i class="glyphicon glyphicon-refresh"></i> 更新排序</a>
                </div>
                <form class="fr" style="display:inline;" id="pagesize" action="" method="get">
                    <label class="form-inline">
                        <select name="pagesize" onchange="document.getElementById('pagesize').submit();" class="form-control">
                            <option
                            <eq name="pagesize" value="10">selected="selected"</eq>
                            value="10">每页10条
                            </option>
                            <option
                            <eq name="pagesize" value="20">selected="selected"</eq>
                            value="20">每页20条
                            </option>
                            <option
                            <eq name="pagesize" value="30">selected="selected"</eq>
                            value="30">每页30条
                            </option>
                            <option
                            <eq name="pagesize" value="50">selected="selected"</eq>
                            value="50">每页50条
                            </option>
                            <option
                            <eq name="pagesize" value="100">selected="selected"</eq>
                            value="100">每页100条
                            </option>
                            <option
                            <eq name="pagesize" value="500">selected="selected"</eq>
                            value="500">每页500条
                            </option>
                        </select>
                    </label>
                    <input type="hidden" name="category_id" value="{$category_id}" />
                    <input type="hidden" name="keywords" value="{$keywords}" />
                </form>
                <div class="fr">{$pages}</div>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<div class="modal fade" id="downloadModal" tabindex="-1" role="dialog" aria-labelledby="downloadModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">发送信息</h4>
            </div>
            <div class="modal-body">
                <div id="download-logged" class="" >
                    <div class="alert alert-info">输入您要发送的内容，然后点击发送。 </div>
                    <p>
                        <textarea style="width:100%; height:200px;" id="save-source"></textarea>
                    </p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" onClick="sendMsg();">发送</button>
                <button type="button" class="btn btn-default" id="cancel-save-btn" data-dismiss="modal">取消</button>
            </div>
        </div>


    </div>

</div>


<div class="modal fade" id="couponModal" tabindex="-1" role="dialog" aria-labelledby="downloadModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">赠送优惠券</h4>
            </div>
            <div class="modal-body">
                <div id="download-logged" class="" >
                    <div class="alert alert-info">请选择你要赠送的优惠券</div>
                    <p>
                        <select name="coupon_id" id="coupon_id" class="form-control">
                            <volist name="coupons" id="coupon">
                                <option value="{$coupon['id']}">{$coupon['title']}</option>
                            </volist>
                        </select>
                    </p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" onClick="sendCoupon();">发送</button>
                <button type="button" class="btn btn-default" id="cancel-save-btn" data-dismiss="modal">取消</button>
            </div>
        </div>


    </div>

</div>
<include file="Public:footer" />